package com.greydawn.ObserverPattern;

/**
 * @Author: zhongwr
 * @Create: 2021/12/6 21:43
 * @Version 1.0
 * @Description: 测试观察者模式
 */
public class ObserverTest {

    public static void main(String[] args) {
        Subject subject = new Subject();

        No1Observer no1Observer = new No1Observer(subject);
        No2Observer no2Observer = new No2Observer(subject);

        subject.setMessage("吃饭了");

        System.out.println("===========吃完饭了========");

        subject.setMessage("洗碗了");

    }
}
